package com.wengluobiancheng.demo04;

import java.io.*;
import java.net.Socket;

public class ClientDemo02 {
    public static void main(String[] args) throws IOException {
        Socket sk = new Socket("192.168.29.222", 10010);
        OutputStream outputStream = sk.getOutputStream();
        outputStream.write("hello".getBytes());
        sk.shutdownOutput();

        BufferedReader br = new BufferedReader(new InputStreamReader(sk.getInputStream()));
        String le;
        while ((le = br.readLine()) != null) {
            System.out.println(le);
        }
        br.close();
        outputStream.close();
        sk.close();


    }
}
